<%@page import="org.ifilm.model.Project"%>
<%@ page import="org.ifilm.model.User,org.ifilm.util.GeneralConstants"%>
<!-- %@page import="org.ifilm.util.GeneralConstants"%>  -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	//TEST TO CHECK WHETHER LOGGED USER IS IN OUR SESSION OR NOT
	User loggedUser = (User) session
			.getAttribute(GeneralConstants.user);

	if (loggedUser != null) {
		System.out.println(loggedUser.getEmail());
	} else {
		System.out.println("No user in session!");
	}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Create Project</title>
<link href="/film/bootstrap/css/bootstrap.min.css" rel="stylesheet"	media="screen" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/film/bootstrap/js/bootstrap.min.js"></script>

<style>
/* 60px to make the container go all the way to the bottom of the topbar */
body {
	padding-top: 60px;
}
</style>
</head>
<body>
	<!-- this area is used for the navigation bar -->
	<!-- where the navigation bar has ifilm home create project sections -->
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="#">iFilm</a>
				<ul class="nav">
					<li><a href="/film/homeDraft.jsp">Home Draft</a></li>
					<li><a href="/film/createProject.jsp">Create Project</a></li>
					<li class="active"><a href="/film/createProjectNew.jsp">Create
							Project New</a></li>
					<li><a href="#">PAGE</a></li>
					<li><a href="#">PAGE</a></li>
				</ul>
				<div class="navbar-text pull-right">
					<a href='/film/userProfile.jsp' class="navbar-link"><%=loggedUser.getName() + " " + loggedUser.getSurname()%>
					</a> <a href='#' id="logout" class="navbar-link">Logout</a>
				</div>
			</div>
		</div>
	</div>
	<!-- In this part, we will get project(film) properties from user such as -->
	<!-- project name, filming location, film subject, language -->
	<!-- start date and estimated shooting time -->
	<div class="container">
		<form method="POST" action="/film/req/project/createProjectTest">
			<table class="table table-condensed">
				<!-- in this row we get project name -->
				<tr>
					<td>Project Name:</td>
					<td><input type="text" name="<%=GeneralConstants.projectName%>"></td>
				</tr>
				<!-- in this row we get filming location -->
				<!-- location will be specified as country and city -->
				<tr>
					<td>Filming Location:</td>
					<td>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Country<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li>Turkey</li>
								<li>Germany</li>
								<li>USA</li>
							</ul>
						</div>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								City<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">Istanbul</a></li>
								<li><a tabindex="-1" href="#">Ankara</a></li>
								<li><a tabindex="-1" href="#">Izmır</a></li>
							</ul>
						</div>
					</td>
				</tr>
				<!-- in this row we get film subject -->
				<tr>
					<td>Film Subject:</td>
					<td><input type="text" name="<%=GeneralConstants.projectSubject%>"></td>
				</tr>
				<!-- in this row we get language of the film -->
				<tr>
					<td>Language:</td>
					<td><input type="text" name="<%=GeneralConstants.projectLanguage%>"></td>
				</tr>
				<!-- in this row we get start time of the film -->
				<!-- this will be in the format day month year -->
				<tr>
					<td>Filming start date:</td>
					<td>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Day<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">1</a></li>
							</ul>
						</div>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Month<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">Ocak</a></li>
							</ul>
						</div>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Year<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">2012</a></li>
							</ul>
						</div>
					</td>
				</tr>

				<!-- in this row we get estimated shooting time of the film -->
				<!-- this will be given as number of days -->
				<tr>
					<td>Estimated shooting time:</td>
					<td>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Days<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">100</a></li>
							</ul>
						</div>
					</td>
				</tr>
				<!-- in this row we get the estimated release date of the project(film) -->
				<tr>
					<td>Estimated Release Date:</td>
					<td>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Day<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">1</a></li>
							</ul>
						</div>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Month<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">Ocak</a></li>
							</ul>
						</div>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
								Year<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">2012</a></li>
							</ul>
						</div>
					</td>
				</tr>
				<!-- this is the fundamental part of create project -->
				<!-- users will define resources such as actors, cameraman etc here -->
				<tr>
					<!-- in this part user will select a job type from the dropdownlist -->
					<!-- after it has been selected user will specify number and description -->
					<!-- in the postings list -->
					<td>
					<!-- this is the job postings part -->
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Job
								Postings<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li class="dropdown-submenu"><a tabindex="-1" href="#">Actors</a>
									<ul class="dropdown-menu">
										<li><a tabindex="-1" href="#">Actor</a></li>
										<li><a tabindex="-1" href="#">Actress</a></li>
										<li><a tabindex="-1" href="#">Dublour</a></li>
									</ul></li>
								<li class="dropdown-submenu"><a tabindex="-1" href="#">Production</a>
									<ul class="dropdown-menu">
										<li><a tabindex="-1" href="#">Script Supervisor</a></li>
										<li><a tabindex="-1" href="#">Production Manager</a></li>
									</ul></li>
								<li class="dropdown-submenu"><a tabindex="-1" href="#">Camera
										Department</a>
									<ul class="dropdown-menu">
										<li><a tabindex="-1" href="#">Cameraman</a></li>
									</ul></li>
								<li><a tabindex="-1" href="#">Costume Department</a></li>
								<li><a tabindex="-1" href="#">Art Department</a></li>
							</ul>
						</div>
					</td>
					<!-- this is the equipment posting part -->
					<td>
						<div class="btn-group">
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Equipment
								Postings<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a tabindex="-1" href="#">Production</a></li>
								<li><a tabindex="-1" href="#">Camera Department</a></li>
								<li><a tabindex="-1" href="#">Costume Department</a></li>
								<li><a tabindex="-1" href="#">Art Department</a></li>
							</ul>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan=2>
						<!-- in this table we will show the user his selected job or equipment postings -->
						<!-- as the user selects new posting from the dropdownlists it will be added  -->
						<!-- to the table and user can specify number and give a full description -->
						<table>
							<thead>
								<tr>
									<th>Job Name</th>
									<th>Number</th>
									<th>Description</th>
									<th>Remove</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>Actress</td>
									<td><div class="btn-group">
											<a class="btn dropdown-toggle" data-toggle="dropdown"
												href="#">2<span class="caret"></span>
											</a>
											<ul class="dropdown-menu">
												<li><a tabindex="-1" href="#">1</a></li>
												<li><a tabindex="-1" href="#">2</a></li>
												<li><a tabindex="-1" href="#">3</a></li>
												<li><a tabindex="-1" href="#">4</a></li>
											</ul>
										</div></td>
									<td><TEXTAREA ROWS=3 COLS=30>20 yaşlarında sarışın bayan aktör arıyorum</TEXTAREA></td>
									<td><input type="checkbox" /></td>
								</tr>
								<tr>
									<td>Director of Photography</td>
									<td><div class="btn-group">
											<a class="btn dropdown-toggle" data-toggle="dropdown"
												href="#">1<span class="caret"></span>
											</a>
											<ul class="dropdown-menu">
												<li><a tabindex="-1" href="#">1</a></li>
												<li><a tabindex="-1" href="#">2</a></li>
												<li><a tabindex="-1" href="#">3</a></li>
												<li><a tabindex="-1" href="#">4</a></li>
											</ul>
										</div></td>
									<td><textarea ROWS=5 COLS=120>Genç, dinamik öğrenmeye hevesi olan görüntü yönetmeni arıyorum</textarea></td>
									<td><input type="checkbox" /></td>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan=2><input type="submit" value="Create"></td>
				</tr>
			</table>
		</form>
	</div>
</body>
<script type="text/javascript">
	$('.dropdown-toggle').dropdown()
	$(".collapse").collapse()
	$("#logout").click(function() {
		$.ajax("/film/req/user/logout").done(function() {
			window.location.href = "/film";
		});
	});
</script>
</html>